﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Modeling_HomePage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UniversityDatabaseManagerment udm = new UniversityDatabaseManagerment();

        if (udm.createConnection() != null && udm.show9NewsByDateTime(udm.createConnection()) != null)
        {
            dlNews.DataSource = udm.show9NewsByDateTime(udm.createConnection());
            dlNews.DataBind();

            dlNewCoures.DataSource = udm.show9NewCoursesByDateStart(udm.createConnection());
            dlNewCoures.DataBind();

            dlAchivements.DataSource = udm.show6Achievements(udm.createConnection());
            dlAchivements.DataBind();

            dlEvents.DataSource = udm.show4EventsByDateTime(udm.createConnection());
            dlEvents.DataBind();
        }
        else 
        {
            Response.Redirect("~/ErrorPage.aspx");
        }
    }
}